const defaultUser = {
  userId: null,
  nickName: null,
  avatar: null
}
export const state = () => ({
  ... defaultUser
})

export const mutations = {
  setUser (state, user) {
    Object.assign(state, {
      userId: user.userId,
      nickName: user.nickName,
      avatar: user.userAvatar
    })
  },
  removeUser (state) {
    Object.assign(state, {
      ...  defaultUser
    })
  }
}
